#pragma once

#include <AST/expr/function/PrototypeAST.hpp>

class FunctionAST : public Expr {
    // 函数原型
    PrototypeAST *proto;

    // 函数体
    Expr *body;

  public:
    FunctionAST(PrototypeAST *proto, Expr *body);

    virtual Function *codegen() override;

    friend class graphviz::GraphGenerator;

    virtual VisitResult accept(ASTVisitor &visitor) const override {
        return visitor.visitFunctionAST(this);
    }
};